/*
 * Cute4jCore.h  0.4.0 / Nov 14, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef CUTE4JCORE_H
#define CUTE4JCORE_H

/*!
 * \brief Common header file for the core module.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */

// Cute4jCore :: Includes. -----------------------------------------------------

#include <QtCore>

#include "Cute4jCommon.h"
#include "JNIWrapper.h"
#include "JVMWrapper.h"
#include "JNILogger.h"
#include "JNIObject.h"
#include "JNIReferences.h"
#include "LocalMonitor.h"
#include "QStringAdapter.h"

// Cute4jCore :: Macro Definitions. --------------------------------------------

#define INIT_CLASS(class, cls) \
    (sm_##class##Class = (jclass)env->NewGlobalRef(cls))
#define INIT_CONSTRUCTOR(constructor, cls, sig) \
    (sm_##constructor##MID = env->GetMethodID(cls, "<init>", sig))
#define INIT_FID(field, cls, sig) \
    (sm_##field##FID = env->GetFieldID(cls, #field, sig))
#define INIT_UFID(field, cls, sig) \
    (sm_##field##FID = env->GetFieldID(cls, "_"#field, sig))
#define INIT_NFID(field, cls, name, sig) \
    (sm_##field##FID = env->GetFieldID(cls, name, sig))
#define INIT_MID(method, cls, sig) \
    (sm_##method##MID = env->GetMethodID(cls, #method, sig))
#define INIT_UMID(method, cls, sig) \
    (sm_##method##MID = env->GetMethodID(cls, "_"#method, sig))
#define INIT_NMID(method, cls, name, sig) \
    (sm_##method##MID = env->GetMethodID(cls, name, sig))

#define FATAL_LOGGED_ERROR(message) LOG_ERROR(message); env->FatalError(message)

#endif // CUTE4JCORE_H
